function showFail(title) {
  my.showToast({
    type: 'fail',
    content: title,
    duration: 3000,
    success: () => {

    },
  });
}

function showSuccess(title) {
  my.showToast({
    type: 'success',
    content: title,
    duration: 3000,
    success: () => {

    },
  });
}

function showMsg(title) {
  my.showToast({
    type: 'none',
    content: title,
    duration: 3000,
    success: () => {

    },
  });
}

function closeMsg() {
  my.hideToast({
    success: function (res) {
      console.log('closeMsg', res);
    },
    fail: function (err) {
      console.log('closeMsg', err);
    }
  });
}

function showLoading(title = '处理中...', mask = true) {

  my.showLoading({
    content: title,
    success: function (res) {
      console.log(res);
      setTimeout(function () {
        closeLoading()
      }, 30000);
    },
    fail: function (err) {
      console.log(err);
    }
  });

}
function showLoadings(title = '获取结果中...', mask = true) {

  my.showLoading({
    content: title,
    success: function (res) {
      console.log(res);
      setTimeout(function () {
        closeLoading()
      }, 30000);
    },
    fail: function (err) {
      console.log(err);
    }
  });

}

function closeLoading() {
  my.hideLoading();
}


module.exports = {
  showSuccess: showSuccess,
  showFail: showFail,
  showMsg: showMsg,
  closeMsg: closeMsg,
  showLoading: showLoading,
  closeLoading: closeLoading,
  showLoadings:showLoadings

}